{template 'public/header'}
{template 'public/comhead'}
<link rel="stylesheet" type="text/css" href="../addons/hyb_o2o/template/public/ygcss.css">
<ul class="nav nav-tabs">
    <span class="ygxian"></span>
    <div class="ygdangq">当前位置:</div>    
    <li {if $op == 'display'} class="active" {/if}><a href="{php echo $this->createWebUrl('usertype',array('op'=>'display'))}">会员等级</a></li>
    <li {if $op == 'post'} class="active" {/if}><a href="{php echo $this->createWebUrl('usertype',array('op'=>'post'))}">添加会员等级</a></li>
</ul>
{if $op =="display"}
<div class="panel panel-default" style="margin-top: 20px;">
    <div class="panel-heading" ></div>
        <div class="panel-body" style="padding: 0px 15px;">
            <div class="row">
                <table class="table we7-table table-hover article-list vertical-middle">
                    <tr>
                        <td style="width:100px">排序</td>
                        <td>等级名称</td>
                        <td>等级图标</td>
                        <td>等级折扣</td>
                        <td>会员金额</td>
                        <td>赠送金额</td>
                        <!-- <td>等级说明</td> -->
                        <td class="text-center">操作</td>
                    </tr>
                    {loop $products $item}
                    <tr>
                        <td>
                            {$item['h_id']}
                        </td>
                        <td>
                            {$item['h_name']}
                        </td>
                        <td>
                            <img src="{media $item['h_thumb']}" style="width:50px;height:50px;" alt="">
                        </td>
                        <td>
                            {$item['h_zhekou']}
                        </td>
                        <td>
                            {$item['h_money']}
                        </td>
                        <td>
                            {$item['h_song']}
                        </td>
   <!--                      <td>
                            {$item['h_content']}
                        </td> -->
                        <td class="text-center">
                            <a class="btn btn-default btn-sm" href="{php echo $this->createWeburl('usertype', array('h_id' => $item['h_id'], 'op' =>'post'))}" >编辑</a>
                            <a class="btn btn-default btn-sm" onclick="return confirm('此操作不可恢复，确认吗？'); return false;" href="{php echo $this->createWeburl('usertype', array('h_id' => $item['h_id'], 'op' => 'delete'))}">删除</a>
                        </td>
                    </tr>
                    {/loop}
                </table>
            </div>
        </div>
    </div>
</div>
<div class="text-right we7-margin-top">
     {$pager}
</div>
{/if}
{if $op == "post"}
<div class="main">
    <form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
        <div class="panel panel-default ygdefault">
            <div class="panel-heading wyheader">
                添加会员等级
            </div>
            <div class="form-group" style="margin-top: 20px">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">等级名称</label>
                <div class="col-sm-8">
                    <input type="text" name="h_name" value="{$items['h_name']}" class="form-control" placeholder="请输入等级名称" />
                </div>
            </div>
            <div class="form-group" style="margin-top: 20px">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">等级图标</label>
                <div class="col-sm-8">
                   {php echo tpl_form_field_image('h_thumb', $items['h_thumb'])}
                </div>
            </div>
            <div class="form-group" style="margin-top: 20px">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label">会员折扣</label>
                <div class="col-sm-8">
                   <input type="text"  name="h_zhekou" value="{$items['h_zhekou']}" class="form-control" placeholder="请输入整数/小数" autocomplete="off">
                </div>
            </div>
            <!-- <div class="form-group" style="margin-top: 20px">
                <label class="col-xs-12 col-sm-3 col-md-2 control-label" >等级说明</label>
                 <div class="col-sm-8">
                    <textarea name="h_content" class="form-control" placeholder="请输入等级说明" cols="30" rows="7">{$items['h_content']}</textarea>
                </div>
            </div> -->
            <div class="form-group" style="margin-top: 20px">
                <label for="" class="col-xs-12 col-sm-3 col-md-2 control-label" >会员金额设置</label>
                 <div class="col-sm-8">
                    <input type="text"  name="h_money" value="{$items['h_money']}" class="form-control ng-pristine ng-untouched ng-valid ng-empty"  placeholder="" autocomplete="off">

                </div>
            </div>
            <div class="form-group"  style="margin-top: 20px">
                <label for="" class="col-xs-12 col-sm-3 col-md-2 control-label" >赠送金额</label>
                 <div class="col-sm-8">
                    <input type="text"  name="h_song" value="{$items['h_song']}" class="form-control"  placeholder="" autocomplete="off">
                </div>
            </div>
            <div class="form-group"  style="margin-top: 20px">
                <label for="" class="col-xs-12 col-sm-3 col-md-2 control-label" >会员有效期</label>
                 <div class="col-sm-6">
                    <input type="text"  name="h_time" value="{$items['h_time']}" class="form-control"  placeholder="请输入整数" autocomplete="off">
                </div>
                <div class="col-sm-1"></div>
                <div class="form-controls col-sm-4 help-block" style="color: red">天</div>
            </div>
        <div class="form-group" style="margin-top: 20px;">
            <input type="submit" name="submit" value="提交" class="btn col-lg-3" style="color: white;background-color: #44ABF7;"/>
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
    </form>
</div>

{/if}
<script type="text/javascript">
    $(function(){
        $("#frame-4").show();
        $("#yframe-4").addClass("wyactive");
    })
</script>
{template "common/footer"}